/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-03-26
 * Time: 21:33
 */
//外部类
class OuterClassB{
    public int data1 = 1;
    public int data2 = 2;
    public static int data3 = 3;
    //实例内部类
    class InnerClassB{
        public int data1 = 999;
        public int data4 = 4;
        public int data5 = 5;
        public static final int data6 = 6;

        public void test(){
            System.out.println("外部类成员变量："+OuterClassB.this.data1); //访问外部类的成员变量
            System.out.println("内部类成员变量："+this.data1); //访问内部类的成员变量
//            System.out.println(data2);
//            System.out.println(data3);
//            System.out.println(data4);
//            System.out.println(data5);
//            System.out.println(data6);
        }
    }
    public static void main(String[] args) {
        OuterClassB outerClass = new OuterClassB();
        OuterClassB.InnerClassB innerClassB = outerClass.new InnerClassB();
        innerClassB.test();
    }
}



public class Test extends OuterClassB.InnerClassB {
    public Test(OuterClassB out){
        out.super();
        // out：外部类的引用
    }
}
